package com.xiaotu.spider.baidu.pipeline;

import com.xiaotu.common.model.DieStarModel;
import com.xiaotu.common.model.StarAwardRecordModel;
import com.xiaotu.common.model.TVAwardRecordModel;
import com.xiaotu.common.util.Constants;
import com.xiaotu.common.util.DataRedisKeyUtils;
import com.xiaotu.spider.APipeline;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;

@Component("StarAwardBaikePipeline")
public class StarAwardBaikePipeline extends APipeline
{
    @Override
    protected void doProcess(ResultItems resultItems, Task task)
    {
        StarAwardRecordModel awardModel = resultItems.get(StarAwardRecordModel.class.getName());
        if (awardModel == null)
            return;
        
        String key = DataRedisKeyUtils.getKey(Constants.DataRedisKey.STAR_AWARD_BAIKE_YYYYMMDD);
		cacheHandler.hSet(key, awardModel.getStarId(), awardModel);
    }

}
